The present invention relates to a cache control method capable of speeding up the write process for writing data from a data processing apparatus into a storage unit by using a cache memory, and a cache control apparatus suitable for practicing the cache control method as above.
For use with information processing systems having a data processing apparatus, a control unit for a cache memory, and a storage unit, respectively interconnected together, there has been proposed the method of controlling the writing of data from the data processing apparatus into the storage unit, as described for example in Japanese Laid-open publication JP-A-55-157053.
According to a first control method described in this related art, a write process by the data processing apparatus is terminated when data have been written in a cache memory. The data stored in the cache memory are written in the storage unit later at a proper time. This write process is called a write-after process. Data written in the cache memory and not still in the storage unit are called write-after data. In the above-mentioned Publication JP-A-55-157053, however, there is not disclosed detailed technology of the manner of how data received from the data processing unit are written in the storage unit.
According to a second control method, the write process by the data processing apparatus is terminated only when data have been written in the storage unit.
According to a third control method, write data supplied from the data processing apparatus are classified into permanent write data and temporary write data. The write process for the permanent write data by the data processing apparatus is terminated only when the data have been written in the storage unit. On the other hand, the write process for the temporary data by the data processing apparatus is terminated when the data have been written in the cache memory, and the temporary data are never written into the storage unit.
Of the three control methods, the second control method does not use a cache memory but directly access the storage unit, and the degree of using the cache memory is considerably limited in the third control method. In view of this, only the first control method is substantially a cache control method that is capable of speeding up the write process.
However, it is difficult to apply the first cache control method for writing data from the data processing apparatus into a record in the storage unit if the record is not stored in the cache memory at that time.
The reason for this is that if at the time of writing data from the data processing apparatus, the corresponding record is not stored in the cache memory, then there is a possibility that the record having a record number designated by the data processing apparatus side is not stored in the storage unit. Furthermore, if the storage unit stores a duplicate of a record having a record number designated by the data processing apparatus side, it is not possible to determine in which record the data are to be written, thereby preventing a correct write-after process.
Thus, the above cache control method is hard to use if a record to be written is not stored in the cache memory at the time of writing data from the data processing apparatus. Speeding up the write process is thus impossible.
There is disclosed in JP-A-59-135563 a technique for a disc controller with a cache memory and a nonvolatile memory. In JP-A-59-15563, the disk controller writes the data received from a data processing unit to both the cache memory and the nonvolatile memory. If the cache memory breaks down before the write-after data in the cache memory are written to the disk unit, the write-after data are ensured in the nonvolatile memory. Therefore, the highly reliable write-after process can be realized. However, there is no consideration in the case where a record for which the data processing unit issues the write request does not exist in the cache memory.
As described above, with the conventional cache control method, the write process can be sped up on condition that a record corresponding to data from the data processing apparatus is being stored in the cache memory at the time of data write, because the write process can be terminated when the data have been stored in the cache memory. However, if a record corresponding to the data is not being stored in the cache memory at the time of data write, it is hard to speed up the write process.